<?php
if (isset($_POST['op']) &&  !empty($_POST['op']) ){
    include 'load.php';
    $openid=$_POST['op'];
    $p=addslashes($_POST['p']);
    $pid=addslashes($_POST['pid']);
    $city=addslashes($_POST['c']);
    $cityid=addslashes($_POST['cid']);
    $address=addslashes($_POST['address']);
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    if (!$mysqli->set_charset("utf8")) {}
    
    if (empty($cityid)){
        $sql="update uinfo set sheng='".$p."',shi='".$city."',dizhi='".$address."' where openid='".$openid."'  ";
    }else{
        $sql="update uinfo set sheng='".$p."',shi='".$city."',pcid='".$pid.'#'.$cityid."',dizhi='".$address."' where openid='".$openid."'  ";
    }
    $mysqli->query($sql);
     
    $mysqli->close();
    echo json_encode(array('msg'=>1));
}